package com.cardone.platform.common.service;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import com.cardone.common.dto.PaginationDto;
import com.cardone.context.ContextHolder;
import com.cardone.platform.common.dao.EntityFileDao;
import com.cardone.platform.common.dto.EntityFileDto;

/**
 * 实体文件服务
 *
 * @author yaohaitao
 *
 */
@Getter
@Setter
public class EntityFileDefaultService implements EntityFileService {
	@Override
	public int deleteByIds(final EntityFileDto deleteEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).deleteByIds(deleteEntityFile);
	}

	@Override
	public <P> P findByCodeOrId(final Class<P> mappedClass, final EntityFileDto findEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).findByCodeOrId(mappedClass, findEntityFile);
	}

	@Override
	public <P> P findById(final Class<P> mappedClass, final EntityFileDto findEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).findById(mappedClass, findEntityFile);
	}

	@Override
	public <P> List<P> findListByLikeCode(final Class<P> mappedClass, final EntityFileDto findListEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).findListByLikeCode(mappedClass, findListEntityFile);
	}

	@Override
	public int insertByCode(final EntityFileDto insertEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).insertByCode(insertEntityFile);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final EntityFileDto paginationEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).paginationByLikeCode(mappedClass, paginationEntityFile);
	}

	@Override
	public Integer readByCodeNqIdForCount(final EntityFileDto readEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).readByCodeNqIdForCount(readEntityFile);
	}

	@Override
	public <P> P saveByIdOrCode(final Class<P> mappedClass, final EntityFileDto saveEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).saveByIdOrCode(mappedClass, saveEntityFile);
	}

	@Override
	public int updateByCode(final EntityFileDto updateEntityFile) {
		return ContextHolder.getBean(EntityFileDao.class).updateByCode(updateEntityFile);
	}
}